//
//  EncryptAndDecode.h
//  ProjectDemo
//
//  Created by ylh on 13-12-24.
//  Copyright (c) 2013年 ylh. All rights reserved.
//

#import <Foundation/Foundation.h>

//base64加密
void *NewBase64Decode(
                      const char *inputBuffer,
                      size_t length,
                      size_t *outputLength);

char *NewBase64Encodestatic(
                      const void *inputBuffer,
                      size_t length,
                      bool separateLines,
                      size_t *outputLength);

@interface NSData (NSDataCoding)

+ (NSData *)dataFromBase64String:(NSString *)aString;//base64解密
- (NSString *)base64EncodedString;//base64加密
//Aes
- (NSData *)AES128EncryptWithKey:(NSString *)key;
- (NSData *)AES128DecryptWithKey:(NSString *)key;
@end

@interface NSString (NSStringCoding)

- (NSMutableString *)MD5;//MD5加密
- (NSString*)base64Encoded;//base64加密
- (NSString*)base64Decoded;//base64解密
- (NSString *)AESEncoded;//AES加密
- (NSString *)AESDecoded;//AES解密
@end